<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

// Route::get('/', function () {
//     return view('welcome');
// });
// Route::get('/req',function (){
//    return 'get';
// });
// Route::post('/req',function (){
//     return 'get';
// });
// Route::put('/req',function (){
//     return 'get';
// });
// Route::delete('/req',function (){
//     return 'get';
// });

// Route::match(['get','post','put'],'/req',function(){
//     dump($_SERVER);
// });
// Route::any('/req',function(){
//     dump($_SERVER);
// });

// Route::get('/req',function(){
//     return 'req';
// })->name('index.req');



/**
 * 路由前缀
 * 
 */
//Route::get('sys/login',function(){
//    return 1;
//});
//Route::get('sys/logout',function(){
//    return 2;
//});
//Route::get('sys/index/welcome',function(){
//    return 3;
//});
//Route::group(['prefix'=>'admin'],function(){
//    Route::get('login',function(){
//        return 11;
//    });
//    Route::get('logout',function(){
//        return 44;
//    });
//    Route::group(['prefix'=>'index'],function(){
//        Route::get('index',function(){
//            return 5678;
//        });
//        Route::get('welcome',function(){
//            return 'sdsd';
//        });
//    });
//});

//如果类和我们controller根目录下不用加命名空间
//Route::get('login','LoginController@index')->name('login');
////Route::get('admin/article/{id}','Admin\AticleController@index')->name('login');\
//Route::group(['namespace'=>'Admin'],function(){
//    Route::get('admin/article/{id}','ArticleController@info')->name('admin.info');
//    });
Route::get('adduser','UserController@index')->name('user.adduser');
Route::post('adduser','UserController@addSave')->name('user.adduser');
Route::get('pdo',function(){
    dump(\DB::connection());
});
Route::get('db','MydbController@db');
Route::get('db2','MydbController@db2');
